{include file="header.html"}
<script src="/js/ckeditor/ckeditor.js"></script>
<style>
td { height:32px;}
</style>
<div class="body">
	<div class="nav"><a href="?app=home&act=index">首页</a> > <a href="?app=push&act=index">推送管理</a> > 添加</div>
		<form class="checkform" action="?app=push&act=save" method="post" enctype="multipart/form-data">
		<input type="hidden" name="id" id="id" value="0" />
		<table class="tap" width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td width="160" class="gra" align="center">标题</td>
				<td><input type="text" name="title" id="title" value="" class="binput coo-need" />
				</td>
			</tr>
			<tr >
                <td width="160" class="gra" align="center">内容</td>
                <td>
                    <textarea  name="content" id="content" style="width:60%;margin-top:20px;" rows="3"></textarea>
                </td>
            </tr>
            <tr>
                
                <td>
                    <label id="show_select_id" style="display: none;padding: 5px;margin-left: 10px;text-decoration-color: #ff0000"></label>
                    <input type="hidden" name="extra_id" id="extra_id" value="">
                    <input type="hidden" name="board_id" id="board_id" value="">
                </td>
            </tr>
            <tr id="extra_url" style="display: none;">
                <td width="160">请输入带http头的完整url：</td>
                <td><input name="url" type="text" ></td>
            </tr>
            <tr>
                <td width="160" class="gra" align="center">人群</td>
                <td>
                    <select name="member_type" onchange="showMemberDialog(this)">
                        <option value=""></option>
                        <option value="1">所有人</option>
                        <option value="2">部分人</option>
                    </select>
                </td>
            </tr>
            <tr id="all_members" style="display: none;">
                <td width="160">选择的成员：</td>
                <td><div id="members"></div></td>
            </tr>
            <tr class="last">
                <td align="center">&nbsp;</td>
                <td><input type="submit" id="Submit" class="submitbtn" value="提 交" onclick="sub()"/></td>
            </tr>
        </table>

        </form>
    </div>
</div>
<script type="text/javascript">
    function sub(id){
        if (!confirm("确认要提交吗？")) {
            window.event.returnValue = false;
        }
    }
    function showTypeDialog(obj){
        document.getElementById("extra_url").style.display="none";
        var iWidth=720;                          //弹出窗口的宽度;
        var iHeight=600;                         //弹出窗口的高度;
        var iTop = (window.screen.availHeight - 30 - iHeight) / 2;
        var iLeft = (window.screen.availWidth - 10 - iWidth) / 2;
        var features = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+iWidth+",height="+iHeight+",top="+iTop+",left="+iLeft;
        switch(obj.value){
            case "1":
                document.getElementById("extra_url").style.display="";
                break;
            case "2":
                window.open("?app=article&act=choose","",features);
                break;
            case "3":
                window.open("?app=forum&act=choose","",features);
                break;
            case "4":
                window.open("?app=tousu&act=choose","",features);
                break;
            default:
                break;
        }
    }
    function showMemberDialog(obj){
        document.getElementById("extra_url").style.display="none";
        var iWidth=1000;                          //弹出窗口的宽度;
        var iHeight=600;                         //弹出窗口的高度;
        var iTop = (window.screen.availHeight - 30 - iHeight) / 2;
        var iLeft = (window.screen.availWidth - 10 - iWidth) / 2;
        var features = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width="+iWidth+",height="+iHeight+",top="+iTop+",left="+iLeft;
        switch(obj.value)
        {
            case "1":
                document.getElementById("all_members").style.display="none";
                document.getElementById("members").innerHTML="";
                break;
            case "2":
                window.open("?app=member&act=choose","",features);
                break;
            default:
                break;
        }
    }
    function onDel(id)
    {
        if(confirm("是否删除？")){
            var picdiv = document.getElementById(id);
            picdiv.parentNode.removeChild(picdiv);
            if(document.getElementById("members").childNodes.length==0)
            {
                 document.getElementById("all_members").style.display="none";
            }
        }
    }
    
</script>
{include file="footer.html"}